import React, { PureComponent } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import { Form, Button, DatePicker, Modal, } from 'antd';

import styles from './styles.less';

const FormItem = Form.Item;

const ModelName = "inv";
@connect(({ loading }) => ({
  loading: loading.models[ModelName],
}))
@Form.create()
class Comp extends PureComponent {

  constructor(props) {
    super(props);

    const { getInstance } = props;
    if (typeof getInstance === 'function') {
      getInstance(this);
    }
  }

  render() {
    const { form: { getFieldDecorator }, } = this.props;
    const { visible, onOk, onCancel } = this.props;


    const getModalContent = () => {
      const formLayout = {
        labelCol: {
          xs: { span: 5 },
          lg: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 15 },
          lg: { span: 15 },
        },
      };


      return (
        <div>
          <Form>
            <FormItem label="核销日期" {...formLayout}>
              {getFieldDecorator('lockDate', {
                initialValue: moment(),
              })(
                <DatePicker />
              )}
            </FormItem>
          </Form >

        </div>
      );
    };

    return (
      <Modal
        title={'核销'}
        destroyOnClose
        visible={visible}
        onOk={onOk}
        onCancel={onCancel}
      >{getModalContent()}
      </Modal>
    );
  }
}

export default Comp;

